﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Details.aspx.vb" Inherits="LondonItalianRestaurants.Details" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="Styles/Restaurant.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <br />
         
        </p>
        <p>
        </p>
    <asp:GridView ID="GridView1" runat="server" 
    AutoGenerateColumns="False" DataSourceID="DetailsSqlDataSource">
    <Columns>
        <asp:BoundField DataField="RestaurantAddress" HeaderText="RestaurantAddress" 
            SortExpression="RestaurantAddress" />
        <asp:BoundField DataField="PhoneNumber" HeaderText="PhoneNumber" 
            SortExpression="PhoneNumber" />
        <asp:BoundField DataField="AveragePrice" HeaderText="AveragePrice" 
            SortExpression="AveragePrice" />
        <asp:ImageField DataImageUrlField="RestaurantPicture2" HeaderText="Thumbnail">
            <ControlStyle CssClass="DetailPicture" />
        </asp:ImageField>
        <asp:HyperLinkField DataNavigateUrlFields="Website" 
            DataNavigateUrlFormatString="{0}" DataTextField="RestaurantName" 
            HeaderText="Website" SortExpression="Website" />
        <asp:HyperLinkField DataNavigateUrlFields="PostCode" 
            DataNavigateUrlFormatString="http://google.co.uk/maps?q={0}" 
            DataTextField="PostCode" HeaderText="Map" SortExpression="Map" />
        <asp:HyperLinkField DataNavigateUrlFields="Restaurantmenu" 
            DataNavigateUrlFormatString="{0}" DataTextField="Restaurantmenu" 
            HeaderText="Menu" SortExpression="Menu" />
            <asp:TemplateField HeaderText="MichelinStars" SortExpression="MichelinStars">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("MichelinStars") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                    <b> 

                        <asp:Label ID="Label1" runat="server" ForeColor="Red" Font-Size="X-Large"  Text='<%# ShowStars(Eval("MichelinStars")) %>'></asp:Label></b>
                    </ItemTemplate>
                </asp:TemplateField>
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="DetailsSqlDataSource" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
    
            SelectCommand="SELECT [RestaurantName], [RestaurantAddress], [PostCode], [PhoneNumber], [AveragePrice], [Restaurantmenu], [Website], [RestaurantPicture2], [MichelinStars] FROM [Restaurants] WHERE ([ID] = ?)">
    <SelectParameters>
        <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
    </SelectParameters>
</asp:SqlDataSource>
    
    <p>
        <asp:CheckBoxList ID="cb_tags" runat="server" 
            DataSourceID="SqlDataSource1" DataTextField="TagName" DataValueField="ID" 
            RepeatDirection="Horizontal">
        </asp:CheckBoxList>
        <br />
        <asp:Button ID="btn_addTagsToDB" runat="server" Text="Tag Restaurant" />
        
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        
        Add New tag<asp:TextBox ID="tb_NewTag" runat="server"></asp:TextBox>
        <asp:Button ID="btn_NewTag"
        runat="server" Text= "Add Tag" />

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT [ID], [TagName] FROM [Tags]"></asp:SqlDataSource>
    </p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
    </p>
</asp:Content>
